using System;

namespace UNLV.IAP.WebControls
{
	/// <summary>
	/// Represents a ValueEntry area used in a SqlWhereBuilder web control.
	/// </summary>
	/// <remarks>
	/// A ValueEntry area, rendered as contents within a &lt;div&gt; tag,
	/// provides the form inputs for a user to enter or select comparison
	/// values given an operator.
	/// </remarks>
	[Serializable]
	public class SqlWhereBuilderValueEntryDiv
	{

		private string _id;
		private string _contents;
		private bool _isUserControl;


		/// <summary>
		/// Unique identifier for this ValueEntry area
		/// </summary>
		public string Id
		{
			get {return _id;} 
			set {_id=value;}
		}

		/// <summary>
		/// Either the HTML/text contents of this ValueEntry area, or
		/// the virtual file name of a UserControl (.ascx file)
		/// </summary>
		public string Contents
		{
			get {return _contents;} 
			set {_contents=value;}
		}

		/// <summary>
		/// Identifies if the <see cref="Contents">Contents</see> property
		/// represents a UserControl (.ascx file)
		/// </summary>
		public bool IsUserControl
		{
			get {return _isUserControl;} 
			set {_isUserControl = value;}
		}

		/// <summary>
		/// Constructs a SqlWhereBuilderValueEntryDiv object
		/// </summary>
		public SqlWhereBuilderValueEntryDiv()
		{
		}

		/// <summary>
		/// Constructs a SqlWhereBuilderValueEntryDiv object, given an id and 
		/// HTML/text contents
		/// </summary>
		/// <param name="id"></param>
		/// <param name="contents"></param>
		public SqlWhereBuilderValueEntryDiv(string id, string contents)
		{
			this.Id = id;
			this.Contents = contents;
			this.IsUserControl = false;
		}

		/// <summary>
		/// Constructs a SqlWhereBuilderValueEntryDiv object, given an id,
		/// and either HTML/text contents or the virtual path of a UserControl
		/// (.ascx file).
		/// </summary>
		/// <param name="id"></param>
		/// <param name="contents"></param>
		/// <param name="isUserControl">true if <i>contents</i> is the virtual path to an .ascx file, false if <i>contents</i> is literal HTML/text</param>
		public SqlWhereBuilderValueEntryDiv(string id, string contents, bool isUserControl)
		{
			this.Id = id;
			this.Contents = contents;
			this.IsUserControl = isUserControl;
		}

	}
}
